package com.kwt.learn.multithread;

/**
 * 三个线程顺序执行 主线程内join
 */
public class Solution02 {

    public static void main(String[] args) throws InterruptedException {
        Thread a = new Thread(() -> {
            System.out.println("a");
        });

        Thread b = new Thread(() -> {
            System.out.println("b");
        });

        Thread c = new Thread(() -> {
            System.out.println("c");
        });

        //a线程启动
        a.start();
        //等待a线程执行完毕
        a.join();
        //启动b线程
        b.start();
        //等待b线程执行完成
        b.join();
        //执行c线程
        c.start();

    }
}
